<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Index extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->library('session');
    }

    public function index()
    {
        $loginErrorCode = $this->session->userdata('loginErrorCode');
        $params = ['loginErrorCode' => '00'];

        if ($loginErrorCode)
        {
            if ($loginErrorCode == "01" || $loginErrorCode == "02")
                $params['loginErrorCode'] = $loginErrorCode;
        }

        $this->session->unset_userdata('loginErrorCode');

        $this->load->view('login', $params);
    }
}